package com.easymin.weixin.entity.sales;

import java.io.Serializable;
import java.util.Date;

/**
 * 活动.
 */
public class ActivityManage implements Serializable {

  private static final long serialVersionUID = 1L;

  public static final int ACTIVITY_STATUS_NOTSTART = 0;
  public static final int ACTIVITY_STATUS_ONUSING = 1;
  public static final int ACTIVITY_STATUS_OVERDUE = 2;

  private Long id;

  private String created;

  private String updated;

  private String centreActivityImage;// 活动中心图片

  private String businessActivityImage;// 业务弹窗图片

  private String chainedAddress;// 链接地址

  private ServiceType serviceType;// 业务类型

  private Long sort;// 排序

  private String showLocation;// 展示位置

  private Long start;// 开始时间

  private Long end;// 结束时间

  private String appKey;

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getCreated() {
    return created;
  }

  public void setCreated(String created) {
    this.created = created;
  }

  public String getUpdated() {
    return updated;
  }

  public void setUpdated(String updated) {
    this.updated = updated;
  }

  public String getCentreActivityImage() {
    return centreActivityImage;
  }

  public void setCentreActivityImage(String centreActivityImage) {
    this.centreActivityImage = centreActivityImage;
  }

  public String getBusinessActivityImage() {
    return businessActivityImage;
  }

  public void setBusinessActivityImage(String businessActivityImage) {
    this.businessActivityImage = businessActivityImage;
  }

  public Long getStart() {
    return start;
  }

  public void setStart(Long start) {
    this.start = start;
  }

  public Date getStartDate() {
    return new Date(start);
  }

  /**
   * 返回活动状态.
   */
  public Integer getTimeStatus() {
    if (start > new Date().getTime()) {
      return ACTIVITY_STATUS_NOTSTART;
    } else if (null != end && end < new Date().getTime()) {
      return ACTIVITY_STATUS_OVERDUE;
    } else {
      return ACTIVITY_STATUS_ONUSING;
    }
  }

  public Long getEnd() {
    return end;
  }

  public void setEnd(Long end) {
    this.end = end;
  }

  /**
   * 结束时间.
   */
  public Date getEndDate() {
    if (null == end) {
      return null;
    } else {
      return new Date(end);
    }
  }

  public String getChainedAddress() {
    return chainedAddress;
  }

  public void setChainedAddress(String chainedAddress) {
    this.chainedAddress = chainedAddress;
  }

  public ServiceType getServiceType() {
    return serviceType;
  }

  public void setServiceType(ServiceType serviceType) {
    this.serviceType = serviceType;
  }

  public Long getSort() {
    return sort;
  }

  public void setSort(Long sort) {
    this.sort = sort;
  }

  public String getShowLocation() {
    return showLocation;
  }

  public void setShowLocation(String showLocation) {
    this.showLocation = showLocation;
  }

  public String getAppKey() {
    return appKey;
  }

  public void setAppKey(String appKey) {
    this.appKey = appKey;
  }

  public enum ServiceType {
    /**
     * 代驾.
     */
    daijia,
    /**
     * 专车.
     */
    zhuanche,
    /**
     * 跑腿.
     */
    paotui,
    /**
     * 货运.
     */
    freight,
    /**
     * 专线
     */
   zhuanxian
  }

}
